package com.music.dao;

import com.laoxuai.beans.annotation.Component;
import com.laoxuai.ibatis.support.BaseDao;
import com.music.pojo.Playlist;
import com.music.pojo.Subscribe;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

@Component
public class SubscribeDao extends BaseDao<Subscribe, Integer> {

    public Subscribe getSubscribe(Integer userId, Integer playlistId) throws SQLException {
        return runner.query("select *from t_subscribe where user_id=? and playlist_id=?",new BeanHandler<>(Subscribe.class),userId,playlistId);
    }
}
